package com.xxxy.zyq.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xxxy.zyq.blockhandler.MonitorBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/monitor")
public class MonitorController {

    @GetMapping("/test")
    @SentinelResource(value = "monitorResource",
            blockHandler = "handlerException",
            blockHandlerClass = MonitorBlockHandler.class)
    public String testMonitor() {
        return "监控服务正常";
    }
    @GetMapping("/info")
    @SentinelResource(value = "monitorInfo",
            blockHandler = "handlerException",
            blockHandlerClass = MonitorBlockHandler.class)
    public String getMonitorInfo() {
        return "监控服务信息";
    }
}